package ink.xiaobaibai.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import ink.xiaobaibai.entity.BuyOrder;
import ink.xiaobaibai.entity.LogisticsBuy;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-06-12
 */
public interface BuyOrderDao extends BaseMapper<BuyOrder> {

    @Select("SELECT COUNT(*) FROM logistics_buy WHERE send = 0")
    Integer getLogisticsListByNoSendCount();

    @Select("SELECT * FROM logistics_buy WHERE send = 0 LIMIT #{limitStart},#{limitEnd}")
    List<LogisticsBuy> getLogisticsListByNoSend(@Param("limitStart") Integer limitStart, @Param("limitEnd") Integer limitEnd);

}
